package com.taxi.apiDriver.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @Author: ruomengjiang
 * @Date: 2022/9/17
 * @Description : com.taxi.apiDriver.controller
 * @Version: 1.0
 */
@RestController
public class TestController {

    /**
     * 需要授权的接口
     * @return
     */
    @GetMapping("/auth")
    public String testAuth(){
        return  "auth";
    }

    /**
     * 不需要授权的接口
     * @return
     */
    @GetMapping("/noauth")
    public String testNoAuth(){
        return "no auth";
    }


    @GetMapping("/test")
    public String test(HttpServletRequest httpServletRequest){
        String day = httpServletRequest.getHeader("day1");
        System.out.println("请求头，网关加的:"+day);
        return "api-driver";
    }
}
